Creates a short-lived auth token for a driver.
Rate limit: 100 requests/min (learn more about rate limits here).
To use this endpoint, select Write Driver Auth Token under the Drivers category when creating or editing an API token. Learn More.
Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should NOT rely on these APIs to build business critical applications
Samsara may change the structure of a preview API’s interface without versioning or any notice to API users.
When an endpoint becomes generally available, it will be announced in the API changelog.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
curl --request POST \
--url https://api.samsara.com/preview/fleet/drivers/create-auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "dp[gZc1wAigz4uGa0Hh",
"externalId": "payrollId:ABFS18600",
"id": 1234,
"username": "johndoe"
}
'{
"data": {
"expirationTime": 1710000000000,
"token": "ZmFrZVRva2VuXzMyQnl0ZXNMb25nRm9yVGVzdA"
}
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Request body for creating a driver auth token. One of id, externalId, or username is required.
Required. Random 12+ character string, used with the auth token to help secure the client from intercepted tokens.
12"dp[gZc1wAigz4uGa0Hh"
Optional. External ID of the driver, in the format key:value (e.g., payrollId:ABFS18600). One of id, externalId, or username is required.
"payrollId:ABFS18600"
Optional. Samsara ID of the driver. One of id, externalId, or username is required.
1234
Optional. Username of the driver. This is the login identifier configured when the driver is created. One of id, externalId, or username is required.
"johndoe"
OK response.
Response object for create driver auth token
Show child attributes
curl --request POST \
--url https://api.samsara.com/preview/fleet/drivers/create-auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "dp[gZc1wAigz4uGa0Hh",
"externalId": "payrollId:ABFS18600",
"id": 1234,
"username": "johndoe"
}
'{
"data": {
"expirationTime": 1710000000000,
"token": "ZmFrZVRva2VuXzMyQnl0ZXNMb25nRm9yVGVzdA"
}
}